(in-package #:lserver)

(defun file-command (function &optional description)
  (add-command (pathname-name *load-truename*) function description))

(defvar *path* (list (merge-pathnames #p"commands/"
				      (lserver-homedir-pathname))))

(defun commands-from-path ()
  (dolist (directory *path*)
    (dolist (file (uiop:directory-files directory "*.lisp"))
      (let ((*package* (find-package "LSERVER")))
        (load file)))))

(commands-from-path)
